#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2021/5/10 9:21
# @Author  : LiShan
# @Email   : lishan_1997@126.com
# @File    : demo_progress.py
# @Note    : this is note
import time
# num = 50         #设置倒计时时间
# timeflush = 0.5   #设置屏幕刷新的间隔时间
# for i in range(0, int(num/timeflush)+1):
#     print("\r正在加载:" + "|" + "*" * i + " "*(int(num/timeflush)+1-i)+"|" + str(i)+"%", end="")
#     time.sleep(timeflush)
# print("\r加载完成！")

test_step = 500
plan = 0
for step in range(test_step):
    progress = int((step + 1) / test_step * 100)
    print("\r正在测试方案" + str(plan) + ":" + "|" + "#" * progress + " " * (100 - progress) + "|"
          + str(progress) + "%", end="")
    time.sleep(0.01)
